package com.resource.controller;

import com.resource.service.OfficeServerService;
import com.resource.utils.ResultBody;
import com.resource.utils.ServiceResultHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.function.BiFunction;

/**
 * @Author: xianggaoxiong
 * @Date: 2020-09-24 19:39
 **/
@RestController
@RequestMapping("/api/server/contract")
public class OfficeServerController {
    @Resource
    private OfficeServerService officeServerService;

    @GetMapping(value = "/list")
    public ResultBody listCompanyInfo(@RequestParam(value = "platformName", required = false) String platformName,
                                      @RequestParam(value = "platformCode", required = false) String platformCode) {
        return ServiceResultHandler.process((BiFunction<Object, Object, Object>) (o, b) -> officeServerService.listContractInfo((String) o, (String) b), platformName, platformCode);
    }
}
